/// <reference path="../typings/index.d.ts" />
/// <reference path="../src/feeService.ts" />
/// <reference path="../src/tms.ts" />


//获取订单回单状态
describe('receiptStatus',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//只有订单编号
    it('get receiptStatus by 1',(done)=>{
    	service.receiptStatus('1').then((res)=>{
        expect(res.data.receiptStatus).toBe('回单部分已回');
        expect(res.data.receiptTime).toBe('2016.02.28');
        expect(res.data.extData).toBe('1');
    	done();
    	},(err)=>{
    		done.fail(err);
    	})
    })	
})

//编辑回单
describe('receipts',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

    //参数全部存在
    it('edit receipts by 1',(done)=>{
    	service.receipts('1','有回单','2016.02.25',[{
      "orderChildId": "1",
      "name": "小明",
      "path": "path"
    }]).then((res)=>{
		expect(res.data.extData).toBe('1|有回单|2016.02.25|1');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})


//获取子单回单附件
describe('childOrderAttachment',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//只有子单编号
    it('get childOrderAttachment by 1 ',(done)=>{
    	service.childOrderAttachment('1').then((res)=>{
            expect(res.data.id).toBe('1');
            expect(res.data.name).toBe('filename');
            expect(res.data.path).toBe('path/**');
            expect(res.data.tag).toBe('tag');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})

//获取合同详情
describe('contractDetail',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

    it('get contractDetail by 1',(done)=>{
    	service.contractDetail('1').then((res)=>{
        expect(res.data.carrierOrderId).toBe('1');
        expect(res.data.altermatePhone).toBe('159');
        expect(res.data.auxiliaryTool).toBe('辅助工具');            
        expect(res.data.contractNumber).toBe('1');            
        expect(res.data.contractStatus).toBe('合同已签');            
        expect(res.data.driverLicenseNumber).toBe('1');            
        expect(res.data.engineNumber).toBe('123');            
        expect(res.data.frameNumber).toBe('456');            
        expect(res.data.goodsUnit).toBe('元/车');            
        expect(res.data.oilCardNumber).toBe('1');
        expect(res.data.oilCardStatus).toBe('有油卡');
        expect(res.data.quantityOfGoods).toBe(12);
        expect(res.data.trailerFrameNumber).toBe('1');
        expect(res.data.trailerNumber).toBe('1');
        expect(res.data.contractTime).toBe('2016.08.31');                  
    	done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})

//改变合同状态
describe('changeContractStatus',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//合同编号  
    it('change contractStatus by 1',(done)=>{
    	service.changeContractStatus('1','有油卡','合同已签').then((res)=>{
        expect(res.data.extData).toBe('1|有油卡|合同已签');          
    	done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})


//修改承运单备注
describe('carrierOrderRemarks',()=>{
    var injector:ng.auto.IInjectorService;
    var service:IFeeService;

    beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

    // 
    it('change carrierOrderRemarks by 1',(done)=>{
        service.carrierOrderRemarks('12','承运单备注').then((res)=>{
        expect(res.data.extData).toBe('12|承运单备注');          
        done();
        },(err)=>{
            done.fail(err);
        })
    })
})



//获取费用详情
describe('feeDetail',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//只有费用编号
    it('get feeDetail by 1',(done)=>{
    	service.feeDetail('1').then((res)=>{
        expect(res.data.carrierOrderId).toBe('12');
        expect(res.data.feeCode).toBe('34');    
        expect(res.data.feeSettleBillCode).toBe('56');    
        expect(res.data.carrier).toBe('布娃娃');    
        expect(res.data.contractNumber).toBe('78');    
        expect(res.data.expenditureReasons).toBe('卸车费');    
        expect(res.data.feeAmount).toBe(5200);    
        expect(res.data.applicant).toBe('客服专员');    
        expect(res.data.creationTime).toBe('2016.03.25');    
        expect(res.data.settleTime).toBe('2016.06.14');    
        expect(res.data.payTime).toBe('2016.09.14');    
        expect(res.data.feeType).toBe('进仓费');    
        expect(res.data.feeStatus).toBe('待结算');    
        expect(res.data.paymentMethod).toBe('现金');    
    	done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})

//应付审核通过
describe('auditedFee',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//只有应付费用编号
    it('put auditedFee by 1',(done)=>{
    	service.auditedFee('1').then((res)=>{
            expect(res.data.extData).toBe('1');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})


//应付费用退回办理
describe('returnManage',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//只有应付费用编号
    it('put returnManage 1',(done)=>{
    	service.returnManage('1').then((res)=>{
            expect(res.data.extData).toBe('1');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})


//添加费用至结算总单
describe('addFeeToParent',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//费用编号,应付总单编号
    it('add feeId by 1 and feeSettleBillId by 2',(done)=>{
    	service.addFeeToParent('1111','2222').then((res)=>{
            expect(res.data.extData).toBe('1111|2222');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})

//获取应付结算总单详情
describe('getFeeSettleBillDetail',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//只有应付结算总单编号
    it('get FeeSettleBillDetail by 1',(done)=>{
    	service.getFeeSettleBillDetail('1').then((res)=>{
    		expect(res.data.id).toBe('12');
    		expect(res.data.billCode).toBe('34');
    		expect(res.data.logisticsId).toBe('56');
    		expect(res.data.carrier).toBe('布娃娃');
    		expect(res.data.carrierId).toBe('78');
    		expect(res.data.carrierPhone).toBe('159');
    		expect(res.data.totalMoney).toBe(10000);
    		expect(res.data.bankName).toBe('中国银行');
    		expect(res.data.bankCode).toBe('6229');
    		expect(res.data.holder).toBe('小花');
    		expect(res.data.description).toBe('应付说明');
    		expect(res.data.settleTime).toBe('2016.03.18');
    		expect(res.data.payTime).toBe('2016.05.23');
    		expect(res.data.reckonerName).toBe('测试物流管理员');
    		expect(res.data.reckonerId).toBe(1111);
    		expect(res.data.auditedUserName).toBe('结算审核人');
    		expect(res.data.auditedUserId).toBe('2222');
    		expect(res.data.feeStatus).toBe('已结算');
    		expect(res.data.isFeeSingle).toBe('是');
    		expect(res.data.isChangeBank).toBe('否');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})


//结算单审核通过
describe('audited',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//只有应付结算总单编号   
    it('audited by  1',(done)=>{
    	service.audited('1').then((res)=>{
    		expect(res.data.extData).toBe('1');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})

//结算单退回结算
describe('returnSettle',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//只有应付结算总单编号  
    it('returnSettle by 1',(done)=>{
    	service.returnSettle('1').then((res)=>{
    		expect(res.data.extData).toBe('1');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})

//已付款
describe('paid',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//只有应付结算总单编号  
    it('paid by 1',(done)=>{
    	service.paid('1').then((res)=>{
            expect(res.data.extData).toBe('1');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})

//获取生成应付结算总单信息
describe('createBill',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//费用列表 
    it('get createBillList by 1',(done)=>{
    	service.createBill('1').then((res)=>{
           expect(res.data.carrier).toBe('结算承运商');
           expect(res.data.carrierId).toBe('12');
           expect(res.data.carrierPhone).toBe('159');
           expect(res.data.totalMoney).toBe(10000);
           expect(res.data.bankName).toBe('中国银行');
           expect(res.data.bankCode).toBe('62166');
           expect(res.data.holder).toBe('小蜡烛');
           expect(res.data.feeList).toBe('费用列表');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})


//获取费用凭证
describe('feeVoucher',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//费用凭证1
    it('get feeVoucher by 1',(done)=>{
    	service.feeVoucher('1').then((res)=>{
           expect(res.data.auditedTime).toBe('2016.07.23');
           expect(res.data.bankCode).toBe('6223');
           expect(res.data.holder).toBe('小花');
           expect(res.data.paymentMethod).toBe('现金');
           expect(res.data.feeAmount).toBe(10000);
           expect(res.data.feeAmountStr).toBe('一万元');
           expect(res.data.description).toBe('事由');
           expect(res.data.oilCardNumber).toBe('1234');
           expect(res.data.feeType).toBe('卸车费');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})


//获取结算单凭证
describe('feeSettleBillVoucher',()=>{
    var injector:ng.auto.IInjectorService;
    var service:IFeeService;

    beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

    //费用凭证1
    it('get feeSettleBillVoucher by 1',(done)=>{
        service.feeSettleBillVoucher('1').then((res)=>{
           expect(res.data.settleTime).toBe('2016.02.06');
           expect(res.data.bankCode).toBe('6223');
           expect(res.data.holder).toBe('小白');
           expect(res.data.paymentMethod).toBe('现金');
           expect(res.data.totalMoney).toBe(10000);
           expect(res.data.totalMoneyStr).toBe('一万元');
           expect(res.data.description).toBe('事由');
            done();
        },(err)=>{
            done.fail(err);
        })
    })
})

//付款人退回
describe('payerReturn',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

	//只有应付结算总单编号  
    it('payer return by 1',(done)=>{
    	service.payerReturn('1').then((res)=>{
            expect(res.data.extData).toBe('1');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})

//添加应付结算总单
describe('addFeeSettleBill',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });


    it("addFee to SettleBill",(done)=>{
    	service.addFeeSettleBill('承运商名称','承运商编号','13563',10000,'中国银行','62984546658','持卡人','应付说明','备注信息',[
    "sample string 1",
    "sample string 2"
  ]).then((res)=>{
      expect(res.data.extData).toBe('承运商名称|承运商编号|13563|10000|中国银行|62984546658|持卡人|应付说明|备注信息|2');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })
})


//获取应付结算总单列表
describe('getFeeSettleBillList',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

    //常规无条件获取
    it("get FeeSettleBillList by feeStatusList \'已结算\'",(done)=>{
    	service.getFeeSettleBillList(null,true,null,null,null,null,null,null,null,null,null,'已结算',null,null,0,10).then((res)=>{
    		expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|true||||||||||已结算|||0|10');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })


    it("get FeeSettleBillList by all exits params",(done)=>{
    	service.getFeeSettleBillList('枚举1',true,'结算总单短号','承运商编号','承运商名称','现金','2016.01','2016.12','10000','结算人编号','合同号','已审核','北京','上海',0,10).then((res)=>{
    		expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('枚举1|true|结算总单短号|承运商编号|承运商名称|现金|2016.01|2016.12|10000|结算人编号|合同号|已审核|北京|上海|0|10');
            done();
    	},(err)=>{
    		done.fail(err);
    	})
    })

    //获取付款方式包含'现金'且结算人编号包含'12'且费用状态包含'已审核'应付结算总单列表
    it("get FeeSettleBillList by paymentMethod \'现金\' and reckonerId \'12\' and feeStatusList \'已审核\' ",(done)=>{
        service.getFeeSettleBillList(null,true,null,null,null,'现金',null,null,null,'12',null,'已审核',null,null,0,10).then((res)=>{
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|true||||现金||||12||已审核|||0|10');
            done();
        },(err)=>{
            done.fail(err);
        })
    })
})



//获取费用列表
describe('getFinanceFeeList',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

   it("get getFinanceFeeList normal",(done)=>{
    	service.getFinanceFeeList(null,true,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,10).then((res)=>{
    	expect(res.data.total).toBeGreaterThan(0);
        expect(res.data.list.length).toBe(10);
        expect(res.data.extData).toBe('|true|||||||||||||||||||||||||||0|10');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })

    it("get FeeSettleBillList by all exits params",(done)=>{
    	service.getFinanceFeeList('枚举1',true,'结算总单短号','费用短号','客户单位名称','客户单位','申领人','合同短号','发货开始时间','发货结束时间','申领开始时间','申领结束时间','结算开始时间','结算结束时间','付款开始时间','付款结束时间','合同状态','回单状态','油卡状态','承运商编号','承运商名称','承运商电话','车牌号','费用类型','费用状态','发货地址','目的地址','付款方式',0,10).then((res)=>{
        expect(res.data.total).toBeGreaterThan(0);
        expect(res.data.list.length).toBe(10);
        expect(res.data.extData).toBe("枚举1|true|结算总单短号|费用短号|客户单位名称|客户单位|申领人|合同短号|发货开始时间|发货结束时间|申领开始时间|申领结束时间|结算开始时间|结算结束时间|付款开始时间|付款结束时间|合同状态|回单状态|油卡状态|承运商编号|承运商名称|承运商电话|车牌号|费用类型|费用状态|发货地址|目的地址|付款方式|0|10");   		
            done();
    	},(err)=>{
    		done.fail(err);
    	})
    })

    // 获取包含费用状态'待结算'的费用列表
    it("get FeeSettleBillList by feeStatus \'待结算\'",(done)=>{
    	service.getFinanceFeeList(null,true,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"待结算",null,null,null,0,10).then((res)=>{
        expect(res.data.total).toBeGreaterThan(0);
        expect(res.data.list.length).toBe(10);
        expect(res.data.extData).toBe("|true|||||||||||||||||||||||待结算||||0|10");
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })

    // 获取合同状态包含'全部'且油卡状态包含'有油卡'且回单状态包含'全部'且费用类型包含'全部'且费用状态包含'待结算'且付款方式包含'全部'的费用列表
    it("get FeeSettleBillList by contractStatus \'全部\' and oilCardStatus \'有油卡\' and receiptStatus \'全部\' and feeType \'全部\' and  feeStatus \'待结算\' and paymentMethod \'全部\'",(done)=>{
        service.getFinanceFeeList(null,true,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'全部','全部','有油卡',null,null,null,null,'全部','待结算',null,null,'全部',0,10).then((res)=>{
        expect(res.data.total).toBeGreaterThan(0);
        expect(res.data.list.length).toBe(10);
        expect(res.data.extData).toBe("|true|||||||||||||||全部|全部|有油卡|||||全部|待结算|||全部|0|10");           
            done();
        },(err)=>{
            done.fail(err);
        })
    })

})


//导出结算单详情费用列表
describe('detailexport',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

    it('export detail by all exits params',(done)=>{
    	service.detailexport('结算总单短号','费用短号','承运商名称','新A12345','合同短号','已结算').then((res)=>{
            expect(res.data.total).toBe(1);
            expect(res.data.list.length).toBe(1);
            expect(res.data.extData).toBe('结算总单短号|费用短号|承运商名称|新A12345|合同短号|已结算');
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })

    //导出费用状态包含'已结算'的结算单详情费用列表
    it('export detail by feeStatus\'已结算\'',(done)=>{
        service.detailexport(null,null,null,null,null,'已结算').then((res)=>{
            expect(res.data.total).toBe(1);
            expect(res.data.list.length).toBe(1);
            expect(res.data.extData).toBe('|||||已结算');
            done();
        },(err)=>{
            done.fail(err);
        })
    })
})


//导出应付费用列表
describe('export',()=>{
	var injector:ng.auto.IInjectorService;
	var service:IFeeService;

	beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });


    it('export feelist by all exits params',(done)=>{
    	service.export("枚举1",true,'结算总单短号','费用短号','客户单位名称','客户单位','申领人','合同短号','发货开始时间','发货结束时间','申领开始时间','申领结束时间','结算开始时间','结算结束时间','付款开始时间','付款结束时间','合同状态','回单状态','油卡状态','承运商编号','承运商名称','承运商电话','车牌号','费用类型','费用状态','发货地址','目的地址','付款方式').then((res)=>{
    		expect(res.data.total).toBe(1);
    		expect(res.data.list.length).toBe(1);
    		expect(res.data.extData).toBe('枚举1|true|结算总单短号|费用短号|客户单位名称|客户单位|申领人|合同短号|发货开始时间|发货结束时间|申领开始时间|申领结束时间|结算开始时间|结算结束时间|付款开始时间|付款结束时间|合同状态|回单状态|油卡状态|承运商编号|承运商名称|承运商电话|车牌号|费用类型|费用状态|发货地址|目的地址|付款方式')
    		done();
    	},(err)=>{
    		done.fail(err);
    	})
    })

    //导出合同状态'合同已签'且回单状态'回单已回'且油卡状态'有油卡且费用类型'全部'且费用状态'已付款'且付款方式'现金'应付费用列表
    it('export feelist by contractStatus\'合同已签\'and receiptStatus\'回单已回\'and oilCardStatus\'有油卡\'and feeType\'全部\'and feeStatus\'已付款\'and paymentMethod\'现金\'',(done)=>{
        service.export(null,true,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'合同已签','回单已回','有油卡',null,null,null,null,'全部','已付款',null,null,'现金').then((res)=>{
            expect(res.data.total).toBe(1);
            expect(res.data.list.length).toBe(1);
            expect(res.data.extData).toBe('|true|||||||||||||||合同已签|回单已回|有油卡|||||全部|已付款|||现金')
            done();
        },(err)=>{
            done.fail(err);
        })
    })
})

//导出应付账单列表
describe('feesettlebillexport',()=>{
    var injector:ng.auto.IInjectorService;
    var service:IFeeService;

    beforeEach(() => {
        injector = angular.injector(['ng','tms']);
        service = injector.get<IFeeService>('feeService');
    });

    
    it("export feesettlebill by all exits params",(done)=>{
        service.feesettlebillexport('枚举1',true,'结算总单短号1','承运商编号','承运商名称','现金','2016.01','2016.12','10000','结算人编号','合同号','已审核','北京','上海').then((res)=>{
            expect(res.data.total).toBe(1);
            expect(res.data.list.length).toBe(1);
            expect(res.data.extData).toBe('枚举1|true|结算总单短号1|承运商编号|承运商名称|现金|2016.01|2016.12|10000|结算人编号|合同号|已审核|北京|上海');
            done();
        },(err)=>{
            done.fail(err);
        })
    })

    //导出包含费用状态'已审核'且结算人编号'2021'且合同号'30012'的应付账单列表
    it("export feesettlebill  by reckonerId \'2021\' and feeStatusList \'已审核\' and contractNumber\'30012\'",(done)=>{
        service.feesettlebillexport(null,true,null,null,null,null,null,null,null,'2021','30012','已审核',null,null).then((res)=>{
            expect(res.data.total).toBe(1);
            expect(res.data.list.length).toBe(1);
            expect(res.data.extData).toBe('|true||||||||2021|30012|已审核||');
            done();
        },(err)=>{
            done.fail(err);
        })
    })


})